<template>
  <div class="revenues-detail-b">
    <van-grid :gutter="10" :column-num="2">
      <van-grid-item>
        <div class="revenues-detail-b-n">{{ list.people }}</div>
        <div class="revenues-detail-b-t">总人数</div>
      </van-grid-item>
      <van-grid-item>
        <div class="revenues-detail-b-n">{{ list.count }}</div>
        <div class="revenues-detail-b-t">总笔数</div>
      </van-grid-item>
      <van-grid-item>
        <div class="revenues-detail-b-n">￥{{ list.avg }}</div>
        <div class="revenues-detail-b-t">单笔均价</div>
      </van-grid-item>
      <van-grid-item>
        <div class="revenues-detail-b-n">￥{{ list.camount }}</div>
        <div class="revenues-detail-b-t">退款金额</div>
      </van-grid-item>
      <van-grid-item>
        <div class="revenues-detail-b-n">{{ list.ctuik }}</div>
        <div class="revenues-detail-b-t">退款笔数</div>
      </van-grid-item>
    </van-grid>
  </div>
</template>

<script>
export default {
  name: "RevenueDetail",
  props: {
    list: {
      type: Object
    }
  },
  data () {
    return {
      active: 2,
      revenueTitle: ["总人数", "总笔数", "单笔均价", "退款金额", "退款笔数"],
      revenueList: {},
    };
  },
  // 单位格式化过滤器
  filters: {
    playvolume: function (number, decimals, dec_point, thousands_sep) {
      decimals = 2;
      number = (number + "").replace(/[^0-9+-Ee.]/g, "");
      var n = !isFinite(+number) ? 0 : +number,
        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
        sep = typeof thousands_sep === "undefined" ? "," : thousands_sep,
        dec = typeof dec_point === "undefined" ? "." : dec_point,
        s = "",
        toFixedFix = function (n, prec) {
          var k = Math.pow(10, prec);
          return "" + Math.ceil(n * k) / k;
        };
      s = (prec ? toFixedFix(n, prec) : "" + Math.round(n)).split(".");
      var re = /(-?\d+)(\d{3})/;
      while (re.test(s[0])) {
        s[0] = s[0].replace(re, "$1" + sep + "$2");
      }
      if ((s[1] || "").length < prec) {
        s[1] = s[1] || "";
        s[1] += new Array(prec - s[1].length + 1).join("0");
      }
      return s.join(dec);
    },
  },
};
</script>

<style lang="less" scoped>
.revenues-detail-b {
  display: flex;
  justify-content: center;
  /deep/ [class*='van-hairline']::after {
    border: 1px solid #ddd;
    border-radius: 30px;
    box-shadow: 0 5px 10px #ddd;
  }
  &-n {
    font-size: 35px;
    font-weight: bold;
    margin-bottom: 30px;
  }
  &-t {
    color: #383838;
    font-size: 30px;
  }
}
</style>